var m_int_PageSize = 15;

Ext.define('AmpleHarvest.objects.groups.window.cListView',
{
	extend		: 'Ext.grid.Panel',
	alias		: 'widget.ampleharvest-objects-groups-window-clistview',
	title		: 'All Groups',
	iconCls		: 'window-group-pendinggroup-icon',
    autoScroll	: true,
//    height 		: '50%',
    columns		: [
              	    { header: 'Group Name',  dataIndex: 'name', flex:1},
              	    { header: 'Status',  dataIndex: 'status', flex:1},
              	    { header: 'Description',  dataIndex: 'description', flex:1},
              	    { header: 'Justification', dataIndex: 'justification', flex: 1 }
              	],
    
    initComponent	: function()
	{
		var obj_This = this;
		
		this.store = Ext.create('AmpleHarvest.DATA.Store.cGroupList',
				{
			pageSize	: m_int_PageSize
		});

		this.dockedItems = [{
            xtype		: 'pagingtoolbar',
            store		: this.store,
            dock		: 'bottom',
            displayInfo	: true
        }],					
		
		this.callParent();
		
		this.on("itemdblclick", this.item_Select, this);
	},
	
	item_Select		: function(obj_View, obj_Record, obj_HTML, int_Index, obj_Event, obj_Options)
	{
		m_obj_AmpleHarvest_ViewPort
				.fireEvent(
						AmpleHarvest.objects.groups.eventHandler.cWindowEvents.C_STR_EVENT_GROUP_OPEN,
						obj_Record['raw'].id
				);
	},
	
	update_store	: function(options)
	{
		this.store.setOptions(options);
		this.store.load();
	}
});